<template>
    <a-form-item :label="Options.Label">
        <a-input-number size="small" style="width:100%" v-model:value="InputValue" :controls="false"
            :addon-after="Options.Unit" />
    </a-form-item>
</template>
<script setup>
import { ref, watch } from 'vue';

const emit = defineEmits(['update:modelValue'])
const props = defineProps({
    Options: Object,
    // 表单数据
    modelValue: Number,
});

const InputValue = ref();

watch(() => props.modelValue, val => {
    InputValue.value = val;
}, { immediate: true });

watch(InputValue, (val) => {
    emit('update:modelValue', val);
})

</script>
<style lang="less" scoped>

</style>